<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
   <head>
       <%@include file="../common/head.jsp" %>
   </head>
  <body >
	  <input type="text" id="snum" value="${wq.snum}">
	  <input type="text"  id="ctx" >
	  <img width="120" src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=${wq.ticket }"/>
		
</body>

<script type="text/javascript">



//主动加载jquery模块
layui.use(['jquery', 'layer'], function(){ 
  var $ = layui.$,layer = layui.layer; //重点处
  var interval;
  var num=0; 
  interval= setInterval(checklogin, 3000);//每三秒请求一次
  
   function checklogin(){
		num++;
		if(num>=20){
			clearInterval(interval);
			alert("二维码已经过期，请刷新获取新的二维码");
			return false;
		}else{
			var url=URLCONT+"/weixinUser/checkqrlogin?snum="+$("#snum").val();
			$.get(url,function(data){
			      if(data==1){
			    	  clearInterval(interval);
			    	  window.location.href=URLCONT+"/weixinUser/list";
			      }
			});
		}
	}
  
});


</script>
</html>
